//
// Created by DengLibin on 2019/1/23 0023.
//

#include <iostream>
#include <vector>
using  namespace std;
struct Point {
    int x;
    int y;
    Point() : x(0), y(0) {}
    Point(int a, int b) : x(a), y(b) {}
};
//分数
struct FenShu{
    int a=1; //分母
    int b=1; //分子
    FenShu(int a, int b) : a(a), b(b) {}
};

FenShu k={0,1};
FenShu b ={0,1};
//二维平面直线函数 y = kx + b
bool flag = false; //标记直线是否垂直与x轴
int x = 0;
void get_k_b(Point & point1, Point & point2){
    if((double)(point1.x - point2.x) != 0){
        k.b = point1.y - point2.y;
        k.a = point1.x - point2.x;
        b.a = k.a;
        b.b = point1.y * k.a - point1.x * k.b;
        flag = false;
    } else{
        x = point1.x;
        flag = true;
    }

}
//是否在直线上
bool onLine(Point & point){
    if(flag){
        return point.x == x;
    }
    //用long long 防止Int 越界
    long long left = (long long)point.y * (long long)k.a;
    long long right = (long long)point.x * k.b + (long long)b.b;
    return left == right;
}
int max_76(int x, int y){
    return x > y ? x : y;
}
/**
 * 给定一个二维平面，平面上有 n 个点，求最多有多少个点在同一条直线上
 * @param points
 * @return
 */
int maxPoints(vector<Point>& points) {
    if(points.size() <=2 ){
        return points.size();
    }
    int max = 0;
    for(int i = 0; i < points.size()-1; i++){
        for(int j = i+1; j < points.size(); j++){
            get_k_b(points[i],points[j]); //两点确定一条直线
            int subMax = 0; //有多少个点在该直线上
            for(int a = 0; a < points.size(); a++){
                if(onLine(points[a])){
                    subMax++;
                }
            }
            max = max_76(max, subMax);
            if(subMax == points.size()){
                return max;
            }

        }
    }
    return  max;
}

int main76(){

    vector<Point> v;
    v.push_back(Point(0,0));
    v.push_back(Point(1,65536));
    v.push_back(Point(65536,0));
    cout << maxPoints(v);
    return 0;
}
